home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 February / EnigmA AMIGA RUN 15 (1997)(G.R. Edizioni)(IT)[!][issue 1997-02][PLANET CD V].iso / amftp165 / install_amftp < prev    next >
Text File  |  1996-09-08  |  18KB  |  402 lines

  1. ;******************************************************************************
  2. ;      ____           ______ ______ ______
  3. ;     / __ \         / ____//_  __// __  /
  4. ;    / /_/ /_   _   / /_     / /  / /_/ /
  5. ;   / __  // \_/ \ / __/    / /  / ____/
  6. ;  / / / // /__/ // /      / /  / /
  7. ; /_/ /_//_/  /_//_/      /_/  /_/
  8. ;
  9. ; $VER: 1.60c (July-13-1996) 
  10. ; AmFTP ©1995,1996 by Mathias Mischler
  11. ; AmFTP Installer ©1995,1996 by Robert C. Reiswig 
  12. ;
  13. ; If you wish to use any part of this installer you must ask. May not be 
  14. ; integrated/placed into any other package. Changes, suggestions or problems:
  15. ; AmFTP@vgr.com or rcr@netcom.com
  16. ;******************************************************************************
  17. ;*** System Stuff ***
  18. (set cpu (database "cpu"))  (set vblank (database "vblank"))
  19. (set graphmem (database "graphics-mem")) (set totmem (database "total-mem"))
  20. (set osver (/ (getversion "LIBS:version.library") 65536))
  21. (if (= vblank "60") ((set blank "NTSC")) ((set blank "PAL")))
  22. (set fastmem (- totmem graphmem))
  23.  
  24. (if (= osver 37) (set workbench "2.0")) (if (= osver 38) (set workbench "2.1"))
  25. (if (= osver 39) (set workbench "3.0")) (if (= osver 40) (set workbench "3.1"))
  26. (if (= osver 41) (set workbench "3.2"))
  27.  
  28. (set cpu (database "cpu"))
  29. (if (= cpu 68000) (set #cpu 0)) (if (= cpu 68010) (set #cpu 1))
  30. (if (= cpu 68020) (set #cpu 2)) (if (= cpu 68030) (set #cpu 3))
  31. (if (= cpu 68040) (set #cpu 4)) 
  32. (if (> (exists ("sys:libs/68060.library")) 0) (set #cpu 5) )
  33.  
  34. (set vernum1 (getversion "AmFTP")) (set ver1 (/ vernum1 65536)) 
  35. (set rev1 (- vernum1 (* ver1 65536) ) ) (set AmFTPver (cat ver1 "." rev1))
  36.  
  37. (if (> (exists ("env:Language")) 0) (set lanfound (getenv "Language")) )
  38. (set lan 0)
  39.  
  40. (if (= "english"    lanfound) (set lan 0))  (if (= "deutsch"    lanfound) (set lan 1))
  41. (if (= "svenska"    lanfound) (set lan 2))  (if (= "suomi"      lanfound) (set lan 3))
  42. (if (= "français"   lanfound) (set lan 4))  (if (= "norsk"      lanfound) (set lan 5))
  43. (if (= "español"    lanfound) (set lan 6))  (if (= "greek"      lanfound) (set lan 7)) 
  44. (if (= "nederlands" lanfound) (set lan 8))  (if (= "italiano"   lanfound) (set lan 9)) 
  45. (if (= "bosanski"   lanfound) (set lan 10)) (if (= "dansk"      lanfound) (set lan 11)) 
  46. (if (= "polski"     lanfound) (set lan 12)) (if (= "português"  lanfound) (set lan 13))
  47. (if (> lan 13) (set lan 0))
  48.  
  49. (set #English    "English")  (set #Deutsch    "Deutsch")
  50. (set #Français   "Français") (set #Español    "Español")
  51. (set #Svenska    "Svenska")  (set #Nederlands "Nederlands")
  52. (set #Norsk      "Norsk")    (set #Suomi "Suomi")
  53. (set #Greek      "Greek")    (set #Italiano "Italiano")
  54. (set #Bosanski   "Bosanski") (set #Dansk "Dansk")
  55. (set #Polski     "Polski")   (set #Português "Português")
  56.  
  57. (set mfound 0) (set newicon1 1) 
  58. (set keeper 1) (set firsttime 0)
  59.  
  60. ;********************************************************************
  61. ; English Strings
  62. ;********************************************************************
  63. (set #about (cat "\n\n\nWelcome to\n\nAmFTP " AmFTPver "\n\nCopyright © 1995,1996 by\n\nMathias Mischler\n") )
  64. (set #nomui (cat "\n\nAmFTP uses Magic User Interface (MUI).\n\nThe installer has not found MUI: to be assigned, "
  65.                  "therefore you AmFTP will not work correctly.  You will need to install "
  66.                  "MUI before running AmFTP."
  67.             )
  68. )
  69. (set #whereAmFTP "Where do you wish to install AmFTP. A directory called 'AmFTP' will be created if one is not there. If a copy of AmFTP is found it will be backed up.")
  70. (set muiver "No Version Installed")
  71. (set #newermui "\n\nAmFTP needs version 3.0 or higher of MUI installed to work correctly.\n\nNow would be a good time to Upgrade!\n\n It looks like you have: \n\n")
  72. (set #need-os "\n\nThe 68020 version of AmFTP needs version 3.0 or higher of the Amiga OS installed to work correctly.\n\n It looks like you have: \n\n")
  73. (set #000used "\n\nThe 68000 version will be installed.") 
  74. (set #filethere1 "\n\nThe installer has found AmFTP version ")
  75. (set #filethere2 " at ")
  76. (set #filethere3 "\n\nThe file will be renamed to ")
  77. (set #filethere4 " and it will then be moved to ")
  78. (set #oktodelete1 "\nIs it ok to delete the older AmFTP binary so that the AmFTP Directory can be made?\n")
  79. (set #oktodelete2 "\nIs it ok to delete the older _renamed_ AmFTP binary so that the AmFTP Directory can be made?\n")
  80. (set #backuptoXXX "Back-UP to file named 'AmFTP")
  81. (set #copyover "Copy Over Old Version")
  82. (set #AmFTPfound "\nThe Installer has found a copy of AmFTP already installed. What do you want to do?\n")
  83. (set #askcpu "\nCPU Check: What CPU does the machine have that you are installing AmFTP on? The installer has found:\n")
  84. (set #no020found "\n\nThe 68020 Version of AmFTP , AmFTP020, was not found in this archive the 68000 version was installed.")
  85. (set #newicon "\nDo you wish to copy over one of the AmFTP Icons from the archive? If you have any ToolTypes already set you should select no.\n")
  86. (set #pickicon "\nAmFTP has a number of different icons you can choose from. Which one would you like to use?\n")
  87. (set #nomultiview (cat "The installer could not find multiview or you are running on a 2.0x Amiga. "
  88.                        "The AmFTP Installer will let you choose between a few different icon to use. "
  89.                        "You can use a picture viewer to look at the 'Icons/ftp_Icons.iff' to see the choices side-by-side, "
  90.                        "or you can just look in the Icon drawer from where you are installing AmFTP from."
  91.                   )
  92. )
  93. (set #nonewicon  "No  - ToolTypes already set.")
  94. (set #yesnewicon "Yes - Copy over Icon.")
  95. (set #whatcat "Select the AmFTP Language catalog you wish to install. (N/A = Not Available in this Archive.)")
  96. (set #wherecat "\nWhere do you wish to install the AmFTP Language Catalog? Default is ")
  97. (set #catnofind "Can not find this catalog in this AmFTP archive. You may need to get the complete archive from the support site.")
  98. (set #whatdocs "\nWhat AmFTP documentation would you like to install?\n")
  99. (set #wheredocs "Where would you like the AmFTP documentation you selected to be installed?")
  100. (set #byebye (cat "\nAmFTP Install Complete!\n\n" ))
  101. ;********************************************************************
  102. ; Hello
  103. ;********************************************************************
  104. (message #about)
  105. (welcome) 
  106.  
  107. ;********************************************************************
  108. ; MUI installed?
  109. ;********************************************************************
  110. (if (< (exists "mui:") 2)  (message #nomui) )
  111.  
  112. ;********************************************************************
  113. ; Check for AmFTP020 requs
  114. ;********************************************************************
  115. (set ver 0)
  116. (if (exists "mui:mui") 
  117.  (
  118.   (set vernum (getversion "mui:mui") )
  119.   (set ver (/ vernum 65536)) (set rev (- vernum (* ver 65536) ) )
  120.  
  121.   (if (= ver 7) (set muiver "2.0") )   (if (= ver 8) (set muiver "2.1") )
  122.   (if (= ver 9) (set muiver "2.2") )   (if (= ver 10) (set muiver "2.3") )
  123.   (if (= ver 11) (set muiver "3.0") )  (if (= ver 12) (set muiver "3.1") )
  124.   (if (= ver 13) (set muiver "3.2") )  (if (= ver 14) (set muiver "3.3") )
  125.  )
  126. )
  127.  
  128. (if (< ver 11)   ( (message (cat #newermui muiver))   (set cpuPick 0) ))
  129. ;(if (< osver 39) ( (message (cat #need-os workbench #000used)) (set cpuPick 0) ))
  130.  
  131. ;********************************************************************
  132. ; Ask where to put AmFTP & Make dir if needed
  133. ;********************************************************************
  134. (set Package (getassign "AmiTCP"))
  135.   (if (= Package "") (set Package (getassign "Inet"))
  136. )
  137.  
  138. (set AmFTPdir  (askdir (prompt #whereAmFTP)
  139.                (help   #whereAmFTP)
  140.                     (default Package)
  141.                )  
  142. )
  143.  
  144. (set where AmFTPdir)
  145.  
  146. (if (= 1 (exists (tackon where "AmFTP") ) ) 
  147.   (
  148.     (set vernum1 (getversion (tackon where "AmFTP") ))
  149.     (set ver1 (/ vernum1 65536)) (set rev1 (- vernum1 (* ver1 65536) ) )
  150.     (set AmFTP_old (cat ver1 "." rev1))
  151.  
  152.     (message (cat #filethere1 ver1 "." rev1 #filethere2 where #filethere3 
  153.                   (cat "AmFTP" AmFTP_old) #filethere4 (tackon AmFTPdir "AmFTP") )
  154.     )
  155.     
  156.  
  157.     (copyfiles (source (tackon where "AmFTP"))
  158.                (dest where) 
  159.                (infos)
  160.                (newname (cat "AmFTP" AmFTP_old))
  161.     )
  162.  
  163.     (delete (tackon AmFTPdir "AmFTP") (prompt #oktodelete1) (help #oktodelete1) (confirm) (infos)) 
  164.  
  165.     (if (< (exists (tackon AmFTPdir "AmFTP")) 2) (makedir (tackon AmFTPdir "AmFTP") (infos)) )    
  166.  
  167.     (copyfiles (source (tackon where (cat "AmFTP" AmFTP_old) ))
  168.                        (dest (tackon AmFTPdir "AmFTP")) 
  169.                        (infos)
  170.                
  171.     )
  172.  
  173.     (delete (tackon where (cat "AmFTP" AmFTP_old)) (prompt #oktodelete2) (help #oktodelete2) (confirm) (infos) ) 
  174.  
  175.     ;(set firsttime 1)
  176.  
  177.   )
  178. )
  179.  
  180. (if (< (exists (tackon AmFTPdir "AmFTP")) 2) (makedir (tackon AmFTPdir "AmFTP") (infos)) )
  181. (set where (tackon AmFTPdir "AmFTP"))
  182. (set @default-dest where)
  183.  
  184. ;********************************************************************
  185. ; Check for old & backup
  186. ;********************************************************************
  187. (if (exists (tackon where "AmFTP")) 
  188.   (
  189.       (set vernum1 (getversion (tackon where "AmFTP") ))
  190.       (set ver1 (/ vernum1 65536)) (set rev1 (- vernum1 (* ver1 65536) ) )
  191.       (set AmFTP_old (cat ver1 "." rev1))
  192.  
  193.       (set keeper  (askchoice (choices  (cat #backuptoXXX AmFTP_old "'")  #copyover)
  194.                      (prompt #AmFTPfound)
  195.                  (help   #AmFTPfound)
  196.                      (default 0)
  197.                )
  198.       )    
  199.  
  200.  
  201.       (if (= keeper 0)
  202.          (copyfiles (source (tackon where "AmFTP"))
  203.                      (dest where) 
  204.                      (infos)
  205.                      (newname (cat "AmFTP" AmFTP_old))
  206.          )
  207.       )          
  208.  
  209.       (set firsttime 1)
  210.     
  211.   )
  212. )
  213.  
  214. ;********************************************************************
  215. ; Double Check on the CPU
  216. ;********************************************************************
  217. (set cpuPick (askchoice (choices "68000" "68010" "68020" "68030"
  218.                          "68040" "68060"
  219.                 )
  220.              (prompt #askcpu)
  221.                      (help   #askcpu)
  222.                    (default #cpu)
  223.       )
  224. )
  225.  
  226. ;********************************************************************
  227. ; Copy over correct AmFTP and Icon if wanted
  228. ;********************************************************************
  229. (if (AND (> cpuPick 1) (exists ("AmFTP020")) )
  230.    (copyfiles (source "AmFTP020") (dest where) (optional "nofail") (newname "AmFTP") )
  231.  
  232.    (copyfiles (source "AmFTP") (dest where) (optional "nofail") )
  233. )
  234.  
  235.  
  236. (if (AND (> cpuPick 1) (= (exists ("AmFTP020")) 0) )
  237.  (message #no020found)
  238. )
  239.  
  240. ;(if (= firsttime 0)  (copyfiles (source "AmFTP.info") (dest where) (optional "nofail") ) )
  241.  
  242. (if (exists ("RegisterAmFTP"))
  243.  (copyfiles (source "RegisterAmFTP") (dest where)  (infos) (optional "nofail") )
  244. )
  245.  
  246.  
  247. (if (OR (= keeper 0) (= firsttime 0))
  248.   (
  249.   
  250.    (set newicon (askchoice (choices #yesnewicon #nonewicon)
  251.                            (prompt #newicon)
  252.                        (help   #newicon)
  253.                            (default 0)
  254.             )
  255.    )
  256.  
  257.    (if (= newicon 0) 
  258.      (
  259.        (if (> (exists ("c:multiview")) 0)  ((set #mpath "c:") (set mfound 1)) )
  260.        (if (> (exists ("sys:Utilities/multiview")) 0) ((set #mpath "sys:Utilities") (set mfound 1)) )
  261.        (if (= mfound 1) (run (cat "run " (tackon #mpath "multiview ") "Icons/ftp_Icons.iff")) )
  262.        (if (<> mfound 1) (message #nomultiview))
  263.  
  264.        (set pickicon (askchoice (choices "AmFTP:  World/Disk, 3 Arrows"
  265.                                          "AmFTP2: Amiga w/WorldMap & Sel_Arrow"
  266.                                          "AmFTP3: Amiga w/Earth"
  267.                                 )
  268.                                 (prompt #pickicon)
  269.                                 (help   #pickicon)
  270.                                 (default 0)
  271.             )
  272.        )
  273.  
  274.  
  275.      )
  276.    )
  277.  
  278.    (if (= pickicon 0) (copyfiles (source "Icons/AmFTP.info") (dest where) (newname "AmFTP.info") (optional "nofail") ))
  279.    (if (= pickicon 1) (copyfiles (source "Icons/AmFTP2.info") (dest where) (newname "AmFTP.info") (optional "nofail") ))
  280.    (if (= pickicon 2) (copyfiles (source "Icons/AmFTP3.info") (dest where) (newname "AmFTP.info") (optional "nofail") ))
  281.  
  282.   )
  283. )
  284.  
  285. ;********************************************************************
  286. ; Copy over AmFTPPrefs and Default Config if NOT there
  287. ;********************************************************************
  288. (if (> (exists ("amftpprefs")) 0) 
  289.  (copylib (source "amftpprefs") (dest where) (infos) (optional "nofail") )
  290. )
  291.  
  292. ;********************************************************************
  293. ; Select and copy over Catalog
  294. ;********************************************************************
  295. (procedure catthere
  296.    (set foundcat 0)
  297.    (if (> (exists (cat "Catalogs/" #testcat "/AmFTP.catalog")) 0)   
  298.      (set foundcat 1)
  299.    )
  300. (set #cna " (N/A)")
  301.  
  302. (set #testcat "Deutsch")    (catthere) (if (= foundcat 0) (set #Deutsch    (cat #Deutsch   #cna)) )  
  303. (set #testcat "Svenska")    (catthere) (if (= foundcat 0) (set #Svenska    (cat #Svenska   #cna)) ) 
  304. (set #testcat "Suomi")      (catthere) (if (= foundcat 0) (set #Suomi      (cat #Suomi     #cna)) ) 
  305. (set #testcat "Français")   (catthere) (if (= foundcat 0) (set #Français   (cat #Français  #cna)) ) 
  306. (set #testcat "Norsk")      (catthere) (if (= foundcat 0) (set #Norsk      (cat #Norsk     #cna)) )   
  307. (set #testcat "Español")    (catthere) (if (= foundcat 0) (set #Español    (cat #Español   #cna)) ) 
  308. (set #testcat "Greek")      (catthere) (if (= foundcat 0) (set #Greek      (cat #Greek     #cna)) ) 
  309. (set #testcat "Nederlands") (catthere) (if (= foundcat 0) (set #Nederlands (cat #Nederlands#cna)) )
  310. (set #testcat "Italiano")   (catthere) (if (= foundcat 0) (set #Italiano   (cat #Italiano  #cna)) ) 
  311. (set #testcat "Bosanski")   (catthere) (if (= foundcat 0) (set #Bosanski   (cat #Bosanski  #cna)) ) 
  312. (set #testcat "Dansk")      (catthere) (if (= foundcat 0) (set #Dansk      (cat #Dansk     #cna)) )     
  313. (set #testcat "Polski")     (catthere) (if (= foundcat 0) (set #Polski     (cat #Polski    #cna)) )     
  314. (set #testcat "Português")  (catthere) (if (= foundcat 0) (set #Português  (cat #Português #cna)) ) 
  315.  
  316. (set catalog (askchoice (choices #English #Deutsch #Svenska #Suomi #Français
  317.                                  #Norsk #Español #Greek #Nederlands #Italiano #Bosanski #Dansk #Polski #Português)
  318.                            (prompt #whatcat)
  319.                        (help   #whatcat)
  320.                            (default lan)
  321.              )
  322. )
  323.  
  324. (if (= catalog 0)  (set #lcat #English ))   (if (= catalog 1)  (set #lcat #Deutsch))
  325. (if (= catalog 2)  (set #lcat #Svenska))    (if (= catalog 3)  (set #lcat #Suomi))
  326. (if (= catalog 4)  (set #lcat #Français))   (if (= catalog 5)  (set #lcat #Norsk))    
  327. (if (= catalog 6)  (set #lcat #Español))    (if (= catalog 7)  (set #lcat #Greek))
  328. (if (= catalog 8)  (set #lcat #Nederlands)) (if (= catalog 9)  (set #lcat #Italiano))
  329. (if (= catalog 10) (set #lcat #Bosanski))   (if (= catalog 11) (set #lcat #Dansk))
  330. (if (= catalog 12) (set #lcat #Polski))     (if (= catalog 13) (set #lcat #Português)) 
  331.  
  332. (if (<> catalog 0)
  333.  (
  334.   (if (> (exists (cat "Catalogs/" #lcat "/AmFTP.catalog")) 0)
  335.     (
  336.         (set wherecat  (askchoice (choices (tackon where (cat "Catalogs/" #lcat)) (cat "Locale:Catalogs/" #lcat) )
  337.                                   (prompt (cat #wherecat (tackon where (cat "Catalogs/" #lcat)) "\n"))
  338.                             (help   #wherecat)
  339.                                (default 0)
  340.                        )  
  341.         )
  342.  
  343.       (if (= wherecat 1)
  344.         (
  345.          (if (< (exists "Locale:") 2) ( (makedir "sys:Locale") (makeassign "Locale" "sys:Locale") ) )
  346.          (if (< (exists "Locale:Catalogs") 2) (makedir "sys:Locale/Catalogs") )
  347.          (if (< (exists (cat "Locale:Catalogs/" #lcat)) 2) (makedir (cat "sys:Locale/Catalogs/" #lcat)) )
  348.          (copylib (source (cat "Catalogs/" #lcat "/AmFTP.catalog")) (dest (cat "sys:Locale/Catalogs/" #lcat)) )
  349.         )
  350.   
  351.         (
  352.          (if (< (exists (tackon where "Catalogs")) 2) (makedir (tackon where "Catalogs")) )
  353.          (if (< (exists (tackon where (cat "Catalogs/" #lcat)) ) 2) (makedir (tackon where (cat "Catalogs/" #lcat)) ) )
  354.          (copylib (source (cat "Catalogs/" #lcat "/AmFTP.catalog")) (dest (tackon where (cat "Catalogs/" #lcat)) ) (optional "nofail") )
  355.         )
  356.       )
  357.  
  358.     )
  359.  
  360.     (message (cat "\nCatalogs/" #lcat "/AmFTP.catalog\n\n" #catnofind))
  361.   )
  362.  
  363.  )
  364. )
  365.  
  366. ;********************************************************************
  367. ; Ask and and copy docs if wanted!
  368. ;********************************************************************
  369. (set docs (askoptions (choices "AmFTP.guide" "AmFTP.doc" "AmFTP.Changes")
  370.               (prompt #whatdocs)
  371.                       (help #whatdocs)
  372.                   (default 3)
  373.       )
  374. )
  375.  
  376. (if (<> docs 0)
  377.  (
  378.    (set docsdir (askdir (prompt #wheredocs)
  379.                (help   #wheredocs)
  380.                     (default where)
  381.                 )  
  382.    )
  383.  
  384.    (if (IN docs 0) (copyfiles (source "AmFTP.guide") (dest docsdir) (infos) (optional "nofail") ) )
  385.    (if (IN docs 1) (copyfiles (source "AmFTP.doc") (dest docsdir) (infos) (optional "nofail") ) )
  386.    (if (IN docs 2) (copyfiles (source "AmFTP.Changes") (dest docsdir) (infos) (optional "nofail") ) )
  387.  
  388.  )
  389. )
  390. ;********************************************************************
  391. ; copy keyfile if there 
  392. ;********************************************************************
  393. (if (> (exists "AmFTP.Key") 0)
  394.  (copyfiles (source "AmFTP.Key") (dest where) (infos) (optional "nofail") ) 
  395. )
  396.  
  397. ;********************************************************************
  398. ; End Bye 
  399. ;********************************************************************
  400. (exit #byebye)
  401.